Skip to content

Fix Svelte image module reading the wrong resource field - #79

Merged
alexanderoster merged 1 commit into
alexanderoster:developfrom
krixkrix:svelte-image-resource
Oct 20, 2026
Merged

alexanderoster merged 1 commit into
alexanderoster:developfrom
krixkrix:svelte-image-resource

Conversation

@krixkrix

@krixkrix krixkrix commented Oct 9, 2026

Copy link
Copy Markdown

Summary

ModuleImage.svelte read module.imageresourceuuid, but AMCModule_Image.js sets imageresource, so no <image> content rendered in the Svelte client.

 imageURL
-  module.imageresourceuuid ? app.getImageURL(module.imageresourceuuid) : ''
+  uuid = module.imageresource
+  if (!uuid || uuid === nullUUID || !app) return ''
+  return app.getImageURL(uuid)

The null-UUID check matches the BuildList/PartList/ExecutionList thumbnails. Without it, the core default 00000000-… would request a broken image.

Evidence

WidgetTest, Dashboard → "Machine View" (<image resource="ui_logo">), Svelte client:

  • Before: heading only, no /api/image request
  • After: logo renders at maxheight="80"

Merge Danger

Door: two-way

Blast Radius: Svelte <image> only

ModuleImage.svelte read module.imageresourceuuid, but the core
AMCModule_Image sets imageresource, so no <image> content rendered in
the Svelte client. Read imageresource, and skip the null-UUID default
so an image without a resource renders nothing instead of a broken
image (same guard as the build/part/execution list thumbnails).
@alexanderoster
alexanderoster merged commit 0586678 into alexanderoster:develop Oct 20, 2026
2 checks passed
@krixkrix
krixkrix deleted the svelte-image-resource branch October 22, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants